<template>
	<view>
		<view class="logo-center mx-20">
			<u-gap></u-gap>
			<uni-forms ref="form" :modelValue="form">
				<uni-forms-item name="oldPassword">
					<uni-easyinput v-model="form.oldPassword" placeholder="请输入旧密码" />
				</uni-forms-item>
				<uni-forms-item name="newPassword">
					<uni-easyinput type="password" v-model="form.newPassword" placeholder="请输入新密码"></uni-easyinput>
				</uni-forms-item>
			</uni-forms>
			<u-gap></u-gap>
			<button @click="set">确认</button>
		</view>
	</view>
</template>

<script>
	import {
		login,
		getInfo,
		InfoChange,
		avatarUpload,
		updatePwd
	} from '@/api/login/login.js'
	export default {
		data() {
			return {
				form: {
					newPassword: '',
					oldPassword: ''
				}
			};
		},
		methods: {
			async set() {
				await updatePwd(this.form)
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="scss">
	.logo-center {
		margin-top: 120rpx;

		::v-deep .uni-easyinput__content-input {
			border-bottom: 1rpx solid #D8D8D8;
			font-size: 30rpx;
			height: 80rpx;
		}

		::v-deep .is-input-border {
			border: 0;
		}

		.logo-center-nr {
			letter-spacing: 5rpx;
			font-size: 23rpx;
			display: flex;
			justify-content: space-between;
			color: #555;

			text {
				color: #0091FF;
			}

			.zhuces {
				color: #0091FF;

			}

			::v-deep .uni-radio-input {
				width: 30rpx;
				height: 30rpx
			}
		}
	}
</style>